/ Assembly List / LJCNetCommon / XMLBuilder / GetBegin

Namespace - LJCNetCommon


Parameters
name - The element name.
textState - The current text state values.
htmlAttribs - The element attributes.
addIndent - Indicates if the element can be indented.
childIndent - Indicates if the child indent should be applied.

Returns

The HTML element begin tag.

Syntax

C#
public String GetBegin(String name, TextState textState, Attributes htmlAttribs = null, Boolean addIndent = True, Boolean childIndent = True)

Gets the element begin tag.

Remarks

GetBegin() is an "GetText" method which creates the element opening tag with GetCreate() and returns the text value.
Note: One should set the "addIndent" parameter to false when adding text to the builder after getting the text with a "GetText" method. This is because the the indent has already been added with the "GetText" method.

Example

C#
// Root Method Begin
var textState = new TextState();

// Defaults: IndentCharCount = 2, LineLimit = 80, WrapEnabled = false.
var xb = new XMLBuilder(textState);

// Example Method:
var attribs = new Attributes()
{
{ "name", "Someone" },
};
var result = xb.GetBegin("Person", textState, attribs);

// result:
// <Person name="Someone">

Copyright © Lester J. Clark and Contributors.
Licensed under the MIT License.